package com.candy.service.impl;

import com.candy.dao.AccountDao;
import com.candy.dao.impl.AccountDaoImpl;
import com.candy.service.AccountService;

import java.util.Date;

public class AccountServiceImpl implements AccountService {
    private String username;
    private Integer age;
    private Date birthday;
    private AccountDao accountDao;

    public AccountServiceImpl() {

    }

    public AccountServiceImpl(String username, Integer age, Date birthday) {
        this.username = username;
        this.age = age;
        this.birthday = birthday;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public AccountDao getAccountDao() {
        return accountDao;
    }

    public void setAccountDao(AccountDao accountDao) {
        this.accountDao = accountDao;
    }

    @Override
    public void save() {
        accountDao.saveAccount();
    }

    @Override
    public String toString() {
        return "AccountServiceImpl{" +
                "username='" + username + '\'' +
                ", age=" + age +
                ", birthday=" + birthday +'}';
    }
}
